import Vue from 'vue'
import VueRouter from 'vue-router'
// import HomeView from '../views/HomeView.vue'
// import firstVue from '@/zujianchuanzhi1/first.vue'
// import second from '@/zujianchuanzhi1/second.vue'
// import third from '@/zujianchuanzhi1/third.vue'
// import notfound from '../zujianchuanzhi1/404.vue'
// import one from '../erjiluyou/one.vue'
// import two from '../erjiluyou/two.vue'
// import three from '../erjiluyou/three.vue'
import home from '../zuoye1/home.vue'
import login from '../zuoye1/login.vue'
import firstVue from '../zuoye1/lis/first.vue'
import second from '../zuoye1/lis/second.vue'
import third from '../zuoye1/lis/third.vue'
import forth from '../zuoye1/lis/forth.vue'
import oneVue from '@/zuoye1/lis/one.vue'
import twoVue from '@/zuoye1/lis/two.vue'
import threeVue from '@/zuoye1/lis/three.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    redirect: '/firstVue',
    component: home,
    children: [
      {
        path: '/firstVue',
        name: 'firstVue',
        component: firstVue,
        meta: {
          keepAlive: true
        },
        children: [
          {
            path: '/oneVue',
            name: 'oneVue',
            component: oneVue,
          }, {
            path: '/twoVue',
            name: 'twoVue',
            component: twoVue,
          }, {
            path: '/threeVue',
            name: 'threeVue',
            component: threeVue,
          },
        ]
      },
      {
        path: '/second',
        name: 'second',
        component: second,
      },
      {
        path: '/third/:sum',
        name: 'third',
        component: third,
      },
      {
        path: '/forth/:res',
        name: 'forth',
        component: forth,
      },
    ]
  },
  {
    path: '/',
    name: 'login',
    component: login,
  },
  // {
  //   path: '/first/:hobby',
  //   name: 'first',
  //   // redirect:'second',
  //   component: firstVue
  // },
  // {
  //   path: '/second',
  //   name: 'second',
  //   component: second,
  //   children: [
  //  {
  //     path: '/one',
  //     name: 'one',
  //     component: one,
  //   },
  //   {
  //     path: '/two',
  //     name: 'two',
  //     component: two,
  //   },
  //   {
  //     path: '/three',
  //     name: 'three',
  //     component: three,
  //   },
  //   {
  //     path: 'one',
  //     name: 'one',
  //     component: one,
  //   },
  //   {
  //     path: 'two',
  //     name: 'two',
  //     component: two,
  //   },
  //   {
  //     path: 'three',
  //     name: 'three',
  //     component: three,
  //   },
  // ]
  //   },
  // {
  //   path: '/third',
  //     name: 'third',
  //       component: third
  // },
  // {
  //   path: '*',
  //     component: notfound
  // }
  //通配符路径要写在最下面因为要与上面的一一做比较
  // {
  //   path: '/',
  //   name: 'home',
  //   component: HomeView
  // },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // },
]

const router = new VueRouter({
  routes
})

export default router
